<!DOCTYPE html>
<html>
    <head>
        <script src="vue.js"></script>
    </head>
    <body>
        <div id="app">
            <div ref="self">测试div</div>
           
        </div>
        <script>
           var vm = new Vue({
               el:'#app',
               data:{
                   msg:'张三'
               },
               beforDestroy(){
                   console.log('销毁之前');
                   console.log(this.$refs.self);
                   console.log(this.msg);
                   console.log(vm);
               },
               destroyed(){
                console.log('销毁之后');
                   console.log(this.$refs.self);
                   console.log(this.msg);
                   console.log(vm);
               }
           });
        </script>
    </body>
</html>